package com.zxt.content.copywriting.controller;

import com.zxt.content.common.Bean.Result;
import com.zxt.content.common.exception.ServiceException;
import com.zxt.content.common.utils.ResultCode;
import com.zxt.content.common.utils.ZXTUtils;
import com.zxt.content.copywriting.req.CopywritingApiDTO;
import com.zxt.content.copywriting.resp.PublicCopywritingVO;
import com.zxt.content.copywriting.service.IPublicCopywritingService;
import com.zxt.content.user.resp.BUserVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Objects;

/**
 * @author zxt
 */
@Slf4j
@RequestMapping("/copywriting/publicCopywriting/")
@RestController
@AllArgsConstructor
@Api(tags = "公共文案管理接口")
public class PublicCopywritingController {

    private final IPublicCopywritingService publicCopywritingService;

    @GetMapping("/query")
    @ApiOperation(value = "用户测试接口", notes = "用户测试接口")
    public Result<List<PublicCopywritingVO>> index() {
        return Result.newSuccess(publicCopywritingService.queryList());
    }

    @PostMapping("/printLog")
    @ApiOperation(value = "测试日志接口", notes = "测试日志接口")
    public Result<List<PublicCopywritingVO>> printLog(@RequestBody CopywritingApiDTO dto) {
        return Result.newSuccess(publicCopywritingService.queryList());
    }
}
